import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);
import vuexPersist from "vuex-persist";
export default new Vuex.Store({
  state: {
    search: [],
  },
  mutations: {
    setsearch(state, val) {
      if (state.search.length == 3) {
        state.search.shift();
        state.search.push(val);
      } else {
        state.search.push(val);
      }
    },
  },
  actions: {},
  modules: {},
  plugins: [
    new vuexPersist({
      storage: window.localStorage,
    }).plugin,
  ],
});
